﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace HFModel.VO
{
    public class MenuData
    {
        public string Title { get; set; }
        public string Link { get; set; }
        public int ClassID { get; set; }
        public MenuData(string title ,string link ,int classid) {
            this.Title = title;
            this.Link = link;
            this.ClassID = classid;
        }
    }

    public class MenuDataList
    {
        public List<MenuData> list { get; set; }
    }

    public class MenuController {
        private static MenuController _menuController;
        private static MenuDataList _list;
        public static MenuController C()
        {
            if (_menuController == null)
                _menuController = new MenuController();

            return _menuController;
        }
        public MenuController() {
            if (_list == null)
            {
                _list = new MenuDataList();
                _list.list = new List<MenuData>();
            }

            _list.list.Add(new MenuData("法律咨询", this.getDemain + "/FAQs/ask.aspx", 1));
            _list.list.Add(new MenuData("案例分析", "ziliao.aspx", 1));
            _list.list.Add(new MenuData("法治新闻", "zixun.aspx", 1));
            _list.list.Add(new MenuData("合同范本", "ziliao.aspx", 1));
            _list.list.Add(new MenuData("法律文书", "wenshu.aspx", 1));
            _list.list.Add(new MenuData("法律论文", "ziliao.aspx", 1));
            _list.list.Add(new MenuData("公企文规", "ziliao.aspx", 1));
            _list.list.Add(new MenuData("判裁案例", "ziliao.aspx", 1));
            _list.list.Add(new MenuData("法律知识", "ziliao.aspx", 1));

            _list.list.Add(new MenuData("发布法律咨询", this.getDemain + "/FAQs/ask.aspx", 2));
            _list.list.Add(new MenuData("最新法律咨询", this.getDemain + "/FAQs/asklist.aspx", 2));
            _list.list.Add(new MenuData("一对一咨询", "/zhao.aspx", 2));
            _list.list.Add(new MenuData("法律人才", this.getDemain + "/job/WantedList.aspx", 2));
            _list.list.Add(new MenuData("律师合作", "#", 2));
            _list.list.Add(new MenuData("案件委托", this.getDemain + "/delegate/delegatelist.aspx", 2));
            _list.list.Add(new MenuData("求职信息", this.getDemain + "/job/WantedList.aspx", 2));
            _list.list.Add(new MenuData("招聘信息", this.getDemain + "/job/JobsList.aspx", 2));

            _list.list.Add(new MenuData("律师在线咨询", "/line.aspx", 3));
            _list.list.Add(new MenuData("一对一咨询", "/zhao.aspx", 3));
            _list.list.Add(new MenuData("法律人才", this.getDemain + "/job/JobsList.aspx", 3));
            _list.list.Add(new MenuData("法律咨询", "/flzx.aspx", 3));
            _list.list.Add(new MenuData("律师合作", "#", 3));
            _list.list.Add(new MenuData("案件委托", this.getDemain + "/delegate/delegatelist.aspx", 3));
            _list.list.Add(new MenuData("求职信息", this.getDemain + "/job/WantedList.aspx", 3));
            _list.list.Add(new MenuData("招聘信息", this.getDemain + "/job/JobsList.aspx", 3));
            _list.list.Add(new MenuData("律师访谈", "#", 3));
            _list.list.Add(new MenuData("律师排行", "#", 3));

            _list.list.Add(new MenuData("律师在线咨询", "/line.aspx", 4));
            _list.list.Add(new MenuData("找律师", "/zhao.aspx", 4));
            _list.list.Add(new MenuData("一对一咨询", "/zhao.aspx", 4));
            _list.list.Add(new MenuData("法律咨询", "/flzx.aspx", 4));
            _list.list.Add(new MenuData("律师合作", "#", 4));
            _list.list.Add(new MenuData("案件委托", this.getDemain + "/delegate/delegatelist.aspx", 4));
            _list.list.Add(new MenuData("求职信息", this.getDemain + "/job/WantedList.aspx", 4));
            _list.list.Add(new MenuData("招聘信息", this.getDemain + "/job/JobsList.aspx", 4));
            _list.list.Add(new MenuData("律师排行", "#", 4));

            _list.list.Add(new MenuData("法学动态", this.getDemain + "/news/NewsList.aspx?topicid=27", 5));
            _list.list.Add(new MenuData("经济犯罪", this.getDemain + "/news/NewsList.aspx?topicid=28", 5));
            _list.list.Add(new MenuData("更多常识", this.getDemain + "/news/NewsList.aspx?topicid=29", 5));
            _list.list.Add(new MenuData("要闻", this.getDemain + "/news/NewsList.aspx?topicid=30", 5));
            _list.list.Add(new MenuData("警务常识", this.getDemain + "/news/NewsList.aspx?topicid=31", 5));
            _list.list.Add(new MenuData("刑事案件", this.getDemain + "/news/NewsList.aspx?topicid=32", 5));
            _list.list.Add(new MenuData("刑侦案例", this.getDemain + "/news/NewsList.aspx?topicid=33", 5));
            _list.list.Add(new MenuData("视频资讯", this.getDemain + "/news/NewsList.aspx?topicid=34", 5));
            _list.list.Add(new MenuData("庭审案例", this.getDemain + "/news/NewsList.aspx?topicid=35", 5));
            _list.list.Add(new MenuData("黄赌毒", this.getDemain + "/news/NewsList.aspx?topicid=36", 5));

            _list.list.Add(new MenuData("发布法律咨询", this.getDemain + "/FAQs/ask.aspx", 6));
            _list.list.Add(new MenuData("找律师", "/zhao.aspx", 6));
            _list.list.Add(new MenuData("一对一咨询", "/zhao.aspx", 6));
            _list.list.Add(new MenuData("法律人才", this.getDemain + "/job/JWantedList.aspx", 6));
            _list.list.Add(new MenuData("律师合作", "#", 6));
            _list.list.Add(new MenuData("案件委托", this.getDemain + "/delegate/delegatelist.aspx", 6));
            _list.list.Add(new MenuData("求职信息", this.getDemain + "/job/WantedList.aspx", 6));
            _list.list.Add(new MenuData("招聘信息", this.getDemain + "/job/JobsList.aspx", 6));

            _list.list.Add(new MenuData("发布法律咨询", this.getDemain + "/FAQs/ask.aspx", 7));
            _list.list.Add(new MenuData("法律百科", "#", 7));
            _list.list.Add(new MenuData("判裁案例", this.getDemain + "/source/SourceList.aspx?sourceid=2", 7));
            _list.list.Add(new MenuData("合同范本", this.getDemain + "/source/SourceList.aspx?sourceid=3", 7));
            _list.list.Add(new MenuData("法律文书", this.getDemain + "/wenshu.aspx", 7));
            _list.list.Add(new MenuData("公企文规", this.getDemain + "/source/SourceList.aspx?sourceid=5", 7));
            _list.list.Add(new MenuData("案例分析", this.getDemain + "/source/SourceList.aspx?sourceid=6", 7));
            _list.list.Add(new MenuData("法学论文", this.getDemain + "/source/SourceList.aspx?sourceid=7", 7));
            _list.list.Add(new MenuData("法律常识", this.getDemain + "/source/SourceList.aspx?sourceid=8", 7));
            _list.list.Add(new MenuData("司法考试", this.getDemain + "/source/SourceList.aspx?sourceid=9", 7));

            _list.list.Add(new MenuData("发布咨询", this.getDemain + "/FAQs/ask.aspx", 8));
            _list.list.Add(new MenuData("判裁案例", this.getDemain + "/source/SourceList.aspx?sourceid=2", 8));
            _list.list.Add(new MenuData("合同范本", this.getDemain + "/source/SourceList.aspx?sourceid=3", 8));
            _list.list.Add(new MenuData("法律文书", this.getDemain + "/wenshu.aspx", 8));
            _list.list.Add(new MenuData("公企文规", this.getDemain + "/source/SourceList.aspx?sourceid=5", 8));
            _list.list.Add(new MenuData("案例分析", this.getDemain + "/source/SourceList.aspx?sourceid=6", 8));
            _list.list.Add(new MenuData("法学论文", this.getDemain + "/source/SourceList.aspx?sourceid=7", 8));
            _list.list.Add(new MenuData("法律常识", this.getDemain + "/source/SourceList.aspx?sourceid=8", 8));
            _list.list.Add(new MenuData("司法考试", this.getDemain + "/source/SourceList.aspx?sourceid=9", 8));
        }
        public List<MenuData> getMenu(int ClassID)
        {
            List<MenuData> outList = new List<MenuData>();

            outList = _list.list.FindAll(i => i.ClassID == ClassID);

            return outList;
        }

        public string getDemain
        {
            get { return ConfigurationManager.AppSettings["Domain"].ToString().Trim(); }
        }
    }
}
